package com.ruoyi.production.service.impl.blade;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.production.domain.blade.BladeApply;
import com.ruoyi.production.mapper.blade.BladeApplyMapper;
import com.ruoyi.production.service.blade.IBladeApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.OrderAllocationMapper;
import com.ruoyi.order.domain.OrderAllocation;

/**
 * 刀片申请Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-11
 */
@Service
public class BladeApplyServiceImpl implements IBladeApplyService
{
    @Autowired
    private BladeApplyMapper bladeApplyMapper;
    @Autowired
    private OrderAllocationMapper orderAllocationMapper;

    /**
     * 查询刀片申请
     *
     * @param bladeApplyId 刀片申请ID
     * @return 刀片申请
     */
    @Override
    public BladeApply selectBladeApplyById(Long bladeApplyId)
    {
        return bladeApplyMapper.selectBladeApplyById(bladeApplyId);
    }

    /**
     * 查询刀片申请列表
     *
     * @param bladeApply 刀片申请
     * @return 刀片申请
     */
    @Override
    public List<BladeApply> selectBladeApplyList(BladeApply bladeApply)
    {
        return bladeApplyMapper.selectBladeApplyList(bladeApply);
    }

    /**
     * 新增刀片申请
     *
     * @param bladeApply 刀片申请
     * @return 结果
     */
    @Override
    public int insertBladeApply(BladeApply bladeApply)
    {
        return bladeApplyMapper.insertBladeApply(bladeApply);
    }

    /**
     * 修改刀片申请
     *
     * @param bladeApply 刀片申请
     * @return 结果
     */
    @Override
    public int updateBladeApply(BladeApply bladeApply)
    {
        bladeApply.setUpdateTime(DateUtils.getNowDate());
        return bladeApplyMapper.updateBladeApply(bladeApply);
    }

    /**
     * 批量删除刀片申请
     *
     * @param bladeApplyIds 需要删除的刀片申请ID
     * @return 结果
     */
    @Override
    public int deleteBladeApplyByIds(Long[] bladeApplyIds)
    {
        return bladeApplyMapper.deleteBladeApplyByIds(bladeApplyIds);
    }

    /**
     * 删除刀片申请信息
     *
     * @param bladeApplyId 刀片申请ID
     * @return 结果
     */
    @Override
    public int deleteBladeApplyById(Long bladeApplyId)
    {
        return bladeApplyMapper.deleteBladeApplyById(bladeApplyId);
    }
}
